<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<c:set var="tabmode" value="${empty cookie.tabmode.value ? '1' : cookie.tabmode.value}"/>
<html>
<head>
    <title>潜在客户详细信息${vo.corporationName}</title>
    <meta name="decorator" content="default"/>
    <style type="text/css">
    	#editForm input ,select {margin-bottom: 0px;}
    </style>
</head>
<body>
<div style="padding-bottom: 10px; ">
	<sys:message content="${message}"/>
	<form id="editForm" action="${ctx }/customer/potentialCustomer/save" method="post">
	<input type="hidden" name="id" value="${vo.id }" />
	<input type="hidden" name="addInfoId" value="${vo.addInfoId }" />
	<input type="hidden" name="flag" value="${vo.flag }" />
	<div style="padding: 5px 0px 5px 0px;"><h5>基本信息</h5></div>
	<table class="table table-striped table-bordered table-condensed">
		<tbody>
			<tr>
				<td class="label_td" width="12%">公司名称:</td>
				<td class="text_td" width="38%">
					<c:choose>
						<c:when test="${ vo.flag eq 0 or vo.recordVisibilityRule eq 'private'}">
							<input id="corporationName" name="corporationName" maxlength="50" class="input-medium required" type="text" value="${vo.corporationName}" />
						</c:when>
						<c:otherwise>
							${vo.corporationName}
							<input id="corporationName" name="corporationName" type="hidden" value="${vo.corporationName}" />
						</c:otherwise>
					</c:choose>
				</td>
				<td class="label_td" width="12%">一级来源:</td>
				<td class="text_td" width="38%">
					<input id="source" name="source" type="text" class="input-medium" maxlength="100" value="${vo.source}" />
				</td>
			</tr>
			<tr>
				<td class="label_td">公司域名:</td>
				<td class="text_td">
					<c:choose>
						<c:when test="${ vo.flag eq 0 or vo.recordVisibilityRule eq 'private'}">
							<input id="corporationUrl" name="corporationUrl" maxlength="50" class="input-medium required" type="text" value="${vo.corporationUrl}" />
						</c:when>
						<c:otherwise>
							${vo.corporationUrl}
							<input id="corporationUrl" name="corporationUrl" type="hidden" value="${vo.corporationUrl}" />
						</c:otherwise>
					</c:choose>

				</td>
				<td class="label_td">二级来源:</td>
				<td class="text_td">
					<input id="sourceDesc" name="sourceDesc" type="text" maxlength="100" class="input-medium" value="${vo.sourceDesc}" />
				</td>
			</tr>
			<tr>
				<td class="label_td">联系人:</td>
				<td class="text_td">
					<input id="contactorName" name="contactorName" maxlength="50" class="input-medium required" type="text" value="${vo.contactorName}" />
				</td>
				<td class="label_td">来源设备:</td>
				<td class="text_td">
					<select class="select-medium" name="mobileOrPc">
						<option value="">请选择</option>
						<c:forEach items="${fns:getDictList('POTENTIAL_SOURCE') }" var="ps">
							<c:choose>
								<c:when test="${vo.mobileOrPc == ps.value }">
									<option value="${ps.value}" selected="selected" >${ps}</option>
								</c:when>
								<c:otherwise>
									<option value="${ps.value}" >${ps}</option>
								</c:otherwise>
							</c:choose>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td class="label_td">手机号:</td>
				<td class="text_td">
					<c:choose>
						<c:when test="${ vo.flag eq 0 or vo.recordVisibilityRule eq 'private'}">
							<input id="mobile" name="mobile" maxlength="11" class="input-medium mobile" type="text" value="${vo.mobile}" />
						</c:when>
						<c:otherwise>
							${vo.mobile}
							<input id="mobile" name="mobile" type="hidden" value="${vo.mobile}" />
						</c:otherwise>
					</c:choose>
				</td>
				<td class="label_td">性别:</td>
				<td class="text_td">
					<c:forEach items="${fns:getDictList('sex') }" var="sex">
						<c:choose>
							<c:when test="${vo.contactorSex == sex.value }">
								<input type="radio" name="contactorSex" checked="checked" value="${sex.value}" />${sex}
							</c:when>
							<c:otherwise>
								<input type="radio" name="contactorSex" value="${sex.value}" />${sex}
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</td>
			</tr>
			<tr>
				<td class="label_td">备用电话:</td>
				<td class="text_td">
					<input id="backupTelephone" maxlength="20" class="input-medium simplePhone" name="backupTelephone" type="text" value="${vo.backupTelephone}" />
				</td>
				<td class="label_td">联系人职务:</td>
				<td class="text_td">
					<input id="contactorPosition" name="contactorPosition" class="input-medium" type="text" value="${vo.contactorPosition}" maxlength="50" />
				</td>
			</tr>
			<tr>
				<td class="label_td">固定电话:</td>
				<td class="text_td">
					<c:choose>
						<c:when test="${ vo.flag eq 0 or vo.recordVisibilityRule eq 'private'}">
							<input id="telephone" name="telephone" class="input-medium simplePhone" maxlength="20" type="text" value="${vo.telephone}" />
						</c:when>
						<c:otherwise>
							${vo.telephone}
							<input id="telephone" name="telephone" type="hidden" value="${vo.telephone}" />
						</c:otherwise>
					</c:choose>
				</td>
				<td class="label_td">客户特点:</td>
				<td class="text_td">
					<sys:customerFeature id="customerFeatureId" name="customerFeatureId" withAll="true" 
						allName="请选择" cssClass="select-medium" defaultValue="${vo.customerFeatureId }" ></sys:customerFeature>
				</td>
			</tr>
			<tr>
				<td class="label_td">邮箱:</td>
				<td class="text_td">
						<input id="email" name="email" type="text" maxlength="50" class="input-medium email" value="${vo.email}" />
				</td>
				<td class="label_td">客户类型:</td>
				<td class="text_td">
					<sys:customerType id="customerTypeId" name="customerTypeId" withAll="true" 
						allName="请选择" cssClass="select-medium" defaultValue="${vo.customerTypeId }" ></sys:customerType>
				</td>
			</tr>
			<tr>
				<td class="label_td">省份:</td>
				<td class="text_td">
					<sys:region id="provinceId" name="provinceId" allName="请选择"
                                 withAll="true" defaultValue="${vo.provinceId}"
                                 cssClass="select-medium"></sys:region>
				</td>
				<td class="label_td">意向产品:</td>
				<td class="text_td">
					<sys:productType id="targetProducts" name="targetProducts" withAll="true" 
						allName="请选择" cssClass="select-medium" defaultValue="${vo.targetProducts }" ></sys:productType>
				</td>
			</tr>
			<tr>
				<td class="label_td">QQ:</td>
				<td class="text_td">
					<input id="contactorQq" name="contactorQq" type="text" class="input-medium qq" maxlength="20" value="${vo.contactorQq}" />
				</td>
				<td class="label_td">微信:</td>
				<td class="text_td">
					<input id="contactorWechat" name="contactorWechat" class="input-medium" type="text" maxlength="50" value="${vo.contactorWechat}" />
				</td>
			</tr>
			<tr>
				<td class="label_td">行业:</td>
				<td class="text_td">
					<input id="industry" name="industry" type="text" class="input-medium" maxlength="50" value="${vo.industry}" />
				</td>
                <td class="label_td">权重:</td>
                <td class="text_td">
                    ${vo.weight}
                </td>
			</tr>
		</tbody>
	</table>
	<div style="padding: 5px 0px 5px 0px;"><h5>补充信息</h5></div>
	<table class="table table-striped table-bordered table-condensed table-hover">
		<tbody>
			<tr>
				<td class="label_td" width="12%">公司规模:</td>
				<td class="text_td" width="38%">
					<input id="corporationScale" name="corporationScale" class="input-medium" maxlength="50" type="text" value="${vo.corporationScale}" />
				</td>
				<td class="label_td" width="12%">成立时间:</td>
				<td class="text_td" width="38%">
					<input name="corporationCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${vo.corporationCreateDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>
				</td>
			</tr>
			<tr>
				<td class="label_td">法人姓名:</td>
				<td class="text_td">
					<input id="corporationCorporateName" name="corporationCorporateName" class="input-medium" maxlength="10" type="text" value="${vo.corporationCorporateName}" />
				</td>
				<td class="label_td">法人性别:</td>
				<td class="text_td">
					<c:forEach items="${fns:getDictList('sex') }" var="sex">
						<c:choose>
							<c:when test="${vo.corporationCorporateSex == sex.value }">
								<input type="radio" name="corporationCorporateSex" checked="checked" value="${sex.value}" />${sex}
							</c:when>
							<c:otherwise>
								<input type="radio" name="corporationCorporateSex" value="${sex.value}" />${sex}
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</td>
			</tr>
			<tr>
				<td class="label_td">经营模式:</td>
				<td class="text_td">
					<input id="corporationBusinessModel" name="corporationBusinessModel" class="input-medium" maxlength="50" type="text" value="${vo.corporationBusinessModel}" />
				</td>
				<td class="label_td">公司传真:</td>
				<td class="text_td">
					<input id="corporationFax" name="corporationFax" maxlength="50" class="input-medium" type="text" value="${vo.corporationFax}" />
				</td>
			</tr>
			<tr>
				<td class="label_td">员工人数:</td>
				<td class="text_td">
					<input id="corporationStaffNum" name="corporationStaffNum" class="input-medium" maxlength="50" type="text" value="${vo.corporationStaffNum}" />
				</td>
				<td class="label_td">质量体系:</td>
				<td class="text_td">
					<input id="corporationQualitySystem" name="corporationQualitySystem" class="input-medium" maxlength="50" type="text" value="${vo.corporationQualitySystem}" />
				</td>
			</tr>
			<tr>
				<td class="label_td">注册资金:</td>
				<td class="text_td">
					<input id="corporationRegisterFunds" name="corporationRegisterFunds" class="input-medium" maxlength="50" type="text" value="${vo.corporationRegisterFunds}" />
				</td>
				<td class="label_td">企业类型:</td>
				<td class="text_td">
					<input id="corporationEnterpriseType" name="corporationEnterpriseType" class="input-medium" maxlength="50" type="text" value="${vo.corporationEnterpriseType}" />
				</td>
			</tr>
			<tr>
				<td class="label_td">注册地址:</td>
				<td class="text_td">
					<textarea id="corporationRegisterAddress" name="corporationRegisterAddress" class="input-medium" maxlength="100" rows="2" cols="50">${vo.corporationRegisterAddress}</textarea>
				</td>
				<td class="label_td">公司介绍:</td>
				<td class="text_td">
					<textarea id="corporationIntroduction" name="corporationIntroduction" class="input-medium" maxlength="500" rows="2" cols="50">${vo.corporationIntroduction}</textarea>
				</td>
			</tr>
		</tbody>
	</table>
	<div style="text-align: center;">
		<button type="button" class="btn" onclick="window.history.go(-1);" style="width: 100px;" >取消</button>
		<button class="btn btn-primary"  style="width: 100px;" >保存</button>
	</div>
	</form>
</div>
<script type="text/javascript">
	$(function(){
		$("#editForm").validate({
            focusInvalid:true,
            rules: {
                mobile: {
                    required: function() {return $("#mobile").val()==""&&$("#telephone").val()==""; }
                },
                telephone: {
                    required: function() {return $("#mobile").val()==""&&$("#telephone").val()==""; }
                }
            },
            messages: {
                mobile: {
                    required: "手机、固定电话二选一必填"
                },
                telephone: {
                    required: "手机、固定电话二选一必填"
                }
            },
            submitHandler: function (form) {
                loading('正在提交，请稍等...');
                form.submit();
            }
        });
		$(".basic-area",window.parent.document).css("height",document.body.clientHeight);
	});
</script>
</body>
</html>